#ifndef RSL_DATA_H
#define RSL_DATA_H 1

/* Set of functions and tables with n and n+k data. Schott catalogue data
 * generated with a modified mktables.C from Mario Marengo's VEX glass shader.
 * Other data, n+k, from FreeSnell:
 * http://people.csail.mit.edu/jaffer/FreeSnell/
 * And converted from the Sopra (thin film metrology) database.
 * http://www.sopra-sa.com/index2.php?goto=dl&rub=4
 * note: FreeSnell and Sopra converted n+k data to be added later. */

////////////////////////////////////////////////////////////////////////////////
/* optics */
/* Optical constants for various glasses. These are synced to the "optics"
 * menu - the lookup index is meant to be the value of that menu.
 * The measured quantities come from the Schott catalog, and the data is 
 * sorted in order of increasing dispersion.
 * This function returns the following optical constants:
 * nd - average index of refraction (eta)
 * nspread - IOR delta over the visible range (439nm - 642nm in this
 * implementation)
 * b1,b2,b3, c1,c2,c3 - Sellmeier constants for calculating the dispersion
 * curve.
 * */
/*    "0" "Generic: Crown Glass: [n=1.50, spread=0.010]"
      "1" "Generic: Crystal Quartz: [n=1.54, spread=0.016]"
      "2" "Generic: Light Flint: [n=1.60, spread=0.018]"
      "3" "Generic: Dense Flint: [n=1.75, spread=0.034]"
      "4" "Generic: Diamond: [n=2.42, spread=0.044]"
      "5" "Measured: Flint Crown: N-FK51A"
      "6" "Measured: Phosphate Crown: N-PK52A"
      "7" "Measured: Phosphate Crown: N-PK51"
      "8" "Measured: Flint Crown: N-FK5"
      "9" "Measured: Borosilicate Crown: N-BK10"
      "10" "Measured: Phosphate Crown: P-PK53"
      "11" "Measured: Borosilicate Crown: N-BK7"
      "12" "Measured: Dense Phosphate Crown: N-PSK53"
      "13" "Measured: Dense Phosphate Crown: N-PSK3"
      "14" "Measured: Dense Phosphate Crown: N-PSK53A"
      "15" "Measured: Dense Crown: N-SK5"
      "16" "Measured: Zinc Crown: N-ZK7"
      "17" "Measured: Dense Crown: N-SK11"
      "18" "Measured: Dense Crown: N-SK14"
      "19" "Measured: Crown: K7"
      "20" "Measured: Dense Crown: N-SK16"
      "21" "Measured: Lanthanum Crown: N-LAK21"
      "22" "Measured: Barium Crown: N-BAK2"
      "23" "Measured: Dense Crown: P-SK57"
      "24" "Measured: Crown: N-K5"
      "25" "Measured: Dense Crown: N-SK4"
      "26" "Measured: Lanthanum Crown: N-LAK7"
      "27" "Measured: Dense Crown: N-SK15"
      "28" "Measured: Barium Crown: N-BAK1"
      "29" "Measured: Dense Crown: N-SK2"
      "30" "Measured: Crown: K10"
      "31" "Measured: Barium Crown: N-BAK4"
      "32" "Measured: Lanthanum Crown: N-LAK22"
      "33" "Measured: Lanthanum Crown: N-LAK14"
      "34" "Measured: Lanthanum Crown: N-LAK12"
      "35" "Measured: Lanthanum Crown: N-LAK9"
      "36" "Measured: Lanthanum Crown: N-LAK34"
      "37" "Measured: Short Flint: N-KZFS2"
      "38" "Measured: Barium Light Flint: N-BALF4"
      "39" "Measured: Lanthanum Crown: N-LAK8"
      "40" "Measured: Barium Light Flint: N-BALF5"
      "41" "Measured: Very Dense Crown: N-SSK2"
      "42" "Measured: Lanthanum Crown: N-LAK33A"
      "43" "Measured: Crown/Flint: N-KF9"
      "44" "Measured: Very Dense Crown: N-SSK5"
      "45" "Measured: Lanthanum Crown: N-LAK10"
      "46" "Measured: Very Dense Crown: N-SSK8"
      "47" "Measured: Lanthanum Flint: N-LAF34"
      "48" "Measured: Lanthanum Flint: N-LAF35"
      "49" "Measured: Lanthanum Flint: N-LAF3"
      "50" "Measured: Lanthanum Flint: N-LAF21"
      "51" "Measured: Barium Flint: N-BAF10"
      "52" "Measured: Barium Flint: N-BAF3"
      "53" "Measured: Barium Flint: N-BAF52"
      "54" "Measured: Lanthanum Dense Flint: N-LASF44"
      "55" "Measured: Very Light Flint: LLF1"
      "56" "Measured: Barium Flint: N-BAF51"
      "57" "Measured: Lanthanum Flint: N-LAF2"
      "58" "Measured: Short Flint: N-KZFS4"
      "59" "Measured: Short Flint: KZFSN4"
      "60" "Measured: Lanthanum Flint: N-LAF33"
      "61" "Measured: Barium Flint: N-BAF4"
      "62" "Measured: Lanthanum Dense Flint: N-LASF41"
      "63" "Measured: Short Flint: N-KZFS11"
      "64" "Measured: Lanthanum Flint: N-LAF36"
      "65" "Measured: Lanthanum Dense Flint: P-LASF47"
      "66" "Measured: Light Flint: LF5"
      "67" "Measured: Lanthanum Dense Flint: N-LASF31A"
      "68" "Measured: Lanthanum Dense Flint: N-LASF43"
      "69" "Measured: Short Flint: KZFSN5"
      "70" "Measured: Barium Dense Flint: N-BASF64"
      "71" "Measured: Fluorite Crown: F5"
      "72" "Measured: Lanthanum Dense Flint: N-LASF40"
      "73" "Measured: Fluorite Crown: F4"
      "74" "Measured: Flint: N-F2"
      "75" "Measured: Fluorite Crown: F2"
      "76" "Measured: Short Flint: KZFS12"
      "77" "Measured: Barium Dense Flint: N-BASF2"
      "78" "Measured: Lanthanum Dense Flint: N-LASF45"
      "79" "Measured: Lanthanum Flint: LAFN7"
      "80" "Measured: Lanthanum Flint: N-LAF7"
      "81" "Measured: Short Flint: N-KZFS8"
      "82" "Measured: Dense Flint: SF2"
      "83" "Measured: Dense Flint: N-SF5"
      "84" "Measured: Dense Flint: SF5"
      "85" "Measured: Lanthanum Dense Flint: N-LASF9"
      "86" "Measured: Lanthanum Dense Flint: N-LASF46A"
      "87" "Measured: Dense Flint: N-SF8"
      "88" "Measured: Dense Flint: N-SF64"
      "89" "Measured: Dense Flint: N-SF15"
      "90" "Measured: Dense Flint: SF15"
      "91" "Measured: Dense Flint: N-SF1"
      "92" "Measured: Dense Flint: SF1"
      "93" "Measured: Dense Flint: N-SF10"
      "94" "Measured: Dense Flint: SF10"
      "95" "Measured: Dense Flint: SF4"
      "96" "Measured: Dense Flint: N-SF4"
      "97" "Measured: Dense Flint: N-SF14"
      "98" "Measured: Dense Flint: SF14"
      "99" "Measured: Dense Flint: N-SF56"
      "100" "Measured: Dense Flint: SF56A"
      "101" "Measured: Dense Flint: SF11"
      "102" "Measured: Dense Flint: N-SF11"
      "103" "Measured: Dense Flint: SF6HT"
      "104" "Measured: Dense Flint: SF6"
      "105" "Measured: Dense Flint: N-SF6"
      "106" "Measured: Dense Flint: N-SF6HT"
      "107" "Measured: Dense Flint: SF57"
      "108" "Measured: Dense Flint: SF57HHT"
      "109" "Measured: Dense Flint: N-SF57"
      "110" "Measured: Dense Flint: N-SF57HT"
      "111" "Measured: Dense Flint: N-SF66"
      "112" "Measured: Dense Flint: SF66"
	  */

// Glass ior table for RYGCBV
void
etaTableRYGCBV(
				uniform float model; // [0,112] range
				output uniform float eta[6];
		)
{
	uniform float glassior[678] =
	{
		1.49500, 1.49700, 1.49900, 1.50100, 1.50300, 1.50500,
		1.53200, 1.53520, 1.53840, 1.54160, 1.54480, 1.54800,
		1.59100, 1.59460, 1.59820, 1.60180, 1.60540, 1.60900,
		1.73300, 1.73980, 1.74660, 1.75340, 1.76020, 1.76700,
		2.39100, 2.40260, 2.41420, 2.42580, 2.43740, 2.44900,
		1.48512, 1.48679, 1.48859, 1.49031, 1.49179, 1.49342,
		1.49548, 1.49724, 1.49915, 1.50097, 1.50254, 1.50426,
		1.52685, 1.52883, 1.53098, 1.53303, 1.53481, 1.53676,
		1.48574, 1.48777, 1.48993, 1.49197, 1.49373, 1.49566,
		1.49595, 1.49812, 1.50044, 1.50264, 1.50453, 1.50661,
		1.52492, 1.52722, 1.52971, 1.53208, 1.53415, 1.53642,
		1.51478, 1.51712, 1.51964, 1.52203, 1.52410, 1.52637,
		1.61771, 1.62053, 1.62359, 1.62651, 1.62905, 1.63184,
		1.55014, 1.55267, 1.55539, 1.55798, 1.56022, 1.56268,
		1.61558, 1.61839, 1.62144, 1.62436, 1.62689, 1.62968,
		1.58673, 1.58951, 1.59252, 1.59539, 1.59788, 1.60062,
		1.50639, 1.50880, 1.51140, 1.51387, 1.51601, 1.51836,
		1.56153, 1.56421, 1.56711, 1.56988, 1.57228, 1.57493,
		1.60063, 1.60351, 1.60662, 1.60960, 1.61218, 1.61502,
		1.50902, 1.51146, 1.51411, 1.51663, 1.51883, 1.52125,
		1.61785, 1.62082, 1.62404, 1.62711, 1.62977, 1.63271,
		1.63784, 1.64092, 1.64425, 1.64744, 1.65020, 1.65324,
		1.53771, 1.54032, 1.54315, 1.54586, 1.54821, 1.55081,
		1.58455, 1.58739, 1.59047, 1.59341, 1.59597, 1.59878,
		1.52031, 1.52284, 1.52559, 1.52822, 1.53050, 1.53302,
		1.61012, 1.61313, 1.61641, 1.61954, 1.62226, 1.62526,
		1.64883, 1.65204, 1.65553, 1.65886, 1.66175, 1.66495,
		1.62030, 1.62339, 1.62675, 1.62997, 1.63277, 1.63586,
		1.57004, 1.57290, 1.57601, 1.57900, 1.58160, 1.58448,
		1.60473, 1.60781, 1.61117, 1.61439, 1.61719, 1.62030,
		1.49917, 1.50172, 1.50451, 1.50717, 1.50949, 1.51207,
		1.56631, 1.56923, 1.57241, 1.57547, 1.57813, 1.58107,
		1.64825, 1.65159, 1.65524, 1.65874, 1.66178, 1.66515,
		1.69367, 1.69730, 1.70124, 1.70499, 1.70826, 1.71186,
		1.67487, 1.67839, 1.68224, 1.68593, 1.68915, 1.69271,
		1.68786, 1.69150, 1.69546, 1.69924, 1.70253, 1.70616,
		1.72584, 1.72969, 1.73388, 1.73789, 1.74137, 1.74521,
		1.55578, 1.55877, 1.56200, 1.56508, 1.56776, 1.57072,
		1.57691, 1.57999, 1.58336, 1.58660, 1.58943, 1.59257,
		1.70971, 1.71353, 1.71768, 1.72164, 1.72509, 1.72890,
		1.54487, 1.54779, 1.55099, 1.55406, 1.55675, 1.55974,
		1.61941, 1.62276, 1.62642, 1.62994, 1.63301, 1.63643,
		1.75036, 1.75450, 1.75902, 1.76335, 1.76712, 1.77129,
		1.52096, 1.52386, 1.52704, 1.53011, 1.53279, 1.53578,
		1.65526, 1.65895, 1.66301, 1.66692, 1.67035, 1.67417,
		1.71651, 1.72059, 1.72505, 1.72932, 1.73306, 1.73721,
		1.61469, 1.61822, 1.62210, 1.62586, 1.62915, 1.63283,
		1.76866, 1.77312, 1.77799, 1.78268, 1.78678, 1.79132,
		1.73959, 1.74390, 1.74861, 1.75314, 1.75711, 1.76150,
		1.71334, 1.71759, 1.72227, 1.72681, 1.73079, 1.73522,
		1.78392, 1.78866, 1.79386, 1.79887, 1.80325, 1.80813,
		1.66655, 1.67059, 1.67505, 1.67937, 1.68317, 1.68741,
		1.57967, 1.58322, 1.58713, 1.59093, 1.59428, 1.59804,
		1.60544, 1.60915, 1.61324, 1.61721, 1.62072, 1.62465,
		1.79996, 1.80488, 1.81030, 1.81554, 1.82012, 1.82522,
		1.54522, 1.54861, 1.55237, 1.55601, 1.55922, 1.56282,
		1.64871, 1.65281, 1.65736, 1.66178, 1.66568, 1.67004,
		1.73993, 1.74463, 1.74983, 1.75488, 1.75932, 1.76430,
		1.60997, 1.61391, 1.61822, 1.62239, 1.62605, 1.63013,
		1.61000, 1.61395, 1.61828, 1.62247, 1.62616, 1.63027,
		1.78147, 1.78653, 1.79212, 1.79754, 1.80230, 1.80762,
		1.60232, 1.60623, 1.61057, 1.61480, 1.61854, 1.62276,
		1.83028, 1.83577, 1.84184, 1.84773, 1.85290, 1.85867,
		1.63406, 1.63834, 1.64305, 1.64761, 1.65161, 1.65608,
		1.79492, 1.80026, 1.80618, 1.81192, 1.81699, 1.82265,
		1.80130, 1.80688, 1.81305, 1.81906, 1.82436, 1.83028,
		1.57799, 1.58200, 1.58646, 1.59082, 1.59468, 1.59903,
		1.87773, 1.88385, 1.89065, 1.89725, 1.90308, 1.90958,
		1.80127, 1.80688, 1.81310, 1.81916, 1.82451, 1.83052,
		1.65010, 1.65477, 1.65994, 1.66497, 1.66941, 1.67441,
		1.69968, 1.70470, 1.71030, 1.71578, 1.72065, 1.72613,
		1.59959, 1.60404, 1.60902, 1.61389, 1.61823, 1.62311,
		1.82865, 1.83492, 1.84193, 1.84880, 1.85490, 1.86178,
		1.61254, 1.61725, 1.62253, 1.62771, 1.63233, 1.63754,
		1.61596, 1.62072, 1.62605, 1.63130, 1.63599, 1.64133,
		1.61594, 1.62071, 1.62605, 1.63130, 1.63598, 1.64127,
		1.69136, 1.69675, 1.70276, 1.70864, 1.71386, 1.71975,
		1.66003, 1.66518, 1.67096, 1.67667, 1.68176, 1.68756,
		1.79557, 1.80197, 1.80915, 1.81622, 1.82252, 1.82967,
		1.74434, 1.75034, 1.75706, 1.76366, 1.76954, 1.77619,
		1.74434, 1.75034, 1.75708, 1.76374, 1.76969, 1.77645,
		1.71547, 1.72128, 1.72779, 1.73418, 1.73988, 1.74632,
		1.64311, 1.64844, 1.65444, 1.66035, 1.66564, 1.67164,
		1.66773, 1.67352, 1.68005, 1.68653, 1.69236, 1.69902,
		1.66771, 1.67351, 1.68006, 1.68653, 1.69233, 1.69892,
		1.84394, 1.85128, 1.85957, 1.86777, 1.87512, 1.88348,
		1.89678, 1.90478, 1.91383, 1.92279, 1.93083, 1.93999,
		1.68370, 1.68979, 1.69669, 1.70353, 1.70969, 1.71674,
		1.70036, 1.70682, 1.71413, 1.72141, 1.72797, 1.73549,
		1.69342, 1.69982, 1.70707, 1.71428, 1.72079, 1.72826,
		1.69343, 1.69986, 1.70714, 1.71438, 1.72090, 1.72834,
		1.71161, 1.71830, 1.72589, 1.73344, 1.74026, 1.74807,
		1.71158, 1.71831, 1.72593, 1.73349, 1.74030, 1.74806,
		1.72223, 1.72927, 1.73726, 1.74524, 1.75245, 1.76073,
		1.72218, 1.72925, 1.73728, 1.74529, 1.75251, 1.76079,
		1.74872, 1.75626, 1.76485, 1.77341, 1.78112, 1.78995,
		1.74861, 1.75620, 1.76484, 1.77348, 1.78130, 1.79029,
		1.75505, 1.76293, 1.77193, 1.78093, 1.78910, 1.79851,
		1.75505, 1.76293, 1.77193, 1.78095, 1.78912, 1.79853,
		1.77762, 1.78587, 1.79529, 1.80473, 1.81330, 1.82318,
		1.77760, 1.78587, 1.79530, 1.80474, 1.81328, 1.82309,
		1.77755, 1.78590, 1.79545, 1.80502, 1.81372, 1.82374,
		1.77753, 1.78590, 1.79547, 1.80508, 1.81380, 1.82388,
		1.79772, 1.80641, 1.81633, 1.82627, 1.83526, 1.84559,
		1.79772, 1.80641, 1.81633, 1.82627, 1.83526, 1.84559,
		1.79771, 1.80641, 1.81635, 1.82634, 1.83540, 1.84587,
		1.79771, 1.80641, 1.81635, 1.82634, 1.83540, 1.84587,
		1.83832, 1.84804, 1.85918, 1.87037, 1.88053, 1.89225,
		1.83832, 1.84804, 1.85918, 1.87037, 1.88053, 1.89225,
		1.83832, 1.84803, 1.85918, 1.87042, 1.88066, 1.89252,
		1.83832, 1.84803, 1.85918, 1.87042, 1.88066, 1.89252,
		1.91261, 1.92455, 1.93838, 1.95246, 1.96543, 1.98064,
		1.91257, 1.92456, 1.93841, 1.95242, 1.96523, 1.98014
		};
	
	uniform float i;
	for (i = 0; i < 6; i += 1) {
		eta[i] = glassior[6 * model + i];
	}
}

////////////////////////////////////////////////////////////////////////////////
/* Lafortune lobe data taken from Ryan Heniser's implementation of the
 * Lafortune model (via C shadeop, that is (was) available at The RenderMan
 * Academy (www.rendermanacademy.com), and from Stephen Westin's shader, as
 * well as from Westin-Torrance-Lafortune paper, and Cornell University.
 * Many thanks also to Tek2Shoot for allowing us to use their fitted data from
 * T2S FilePack/T2SMaterial with Shrimp. Further details listed below in their
 * respective sections. */
void
lafortunedata(
				uniform float model; // valid range, or chaos ensues
				output uniform float lobedata[];
		)
{
	uniform float coeffs[1044] = {
		/* Model 0-5 data from Ryan Heniser's implementation of the Lafortune
		 * BRDF (via C shadeop) */
		/* Spray painted latex blue paint (0) */
		 0.877276,  0.877276,  0.801226, 21.8888900,
		 0.857255,  0.857255,  0.774290, 18.5977550,
		 0.670982,  0.670982,  0.586674, 7.47271700,

		-0.419449, -0.419449,  0.008408, 2.59471200,
		-0.406681, -0.406681,  0.017625, 2.58149900,
		-0.477976, -0.477976,  0.227295, 3.67765300,

		-1.031545, -1.031545,  0.706734, 66.8990600,
		-1.029426, -1.029426,  0.696530, 63.7679120,
		-1.026588, -1.026588,  0.687715, 57.4891810,
		/* Matte finished steel (1) */
		-1.118540, -1.118540,  1.012720, 15.8708000,
		-1.118450, -1.118450,  1.014690, 15.6489000,
		-1.119990, -1.119990,  1.019420, 15.4571000,

		-1.053340, -1.053340,  0.695410, 111.267000,
		-1.064090, -1.064090,  0.662178, 88.9222000,
		-1.083780, -1.083780,  0.626672, 65.2179000,

		-1.016840, -1.016840,  1.001320, 180.181000,
		-1.016350, -1.016350,  1.001120, 184.152000,
		-1.015290, -1.015290,  1.001080, 195.773000,
		/* Primer grey (2) */
		-0.399286, -0.399286,  0.167504, 2.46663300,
		-1.033473, -1.033473,  0.009545, 7.63725300,
		-1.058104, -1.058104, -0.068002, 8.11764500,

		-1.041861, -1.041861,  0.014375, 7.99372200,
		-1.100108, -1.100108, -0.198147, 29.4462680,
		-1.087779, -1.087779, -0.053605, 41.9889900,

		-1.098605, -1.098605, -0.145110, 31.8997190,
		-0.379883, -0.379883,  0.159127, 2.37285200,
		-0.449038, -0.449038,  0.173224, 2.63616100,
		/* Skin 1 (caucasian male) (3) */
		-1.131747, -1.131747, -1.209182, 6.42165800,
		-1.016939, -1.016939, -1.462488, 3.69993200,
		-0.966018, -0.966018, -1.222419, 3.52488900,

		-0.546570, -0.546570,  0.380123, 3.68504400,
		-0.643533, -0.643533,  0.410559, 4.26649500,
		-0.638934, -0.638934,  0.437367, 4.53974200,

		-1.020153, -1.020153,  0.703913, 63.9196870,
		-1.027479, -1.027479,  0.573625, 43.8098660,
		-0.998888, -0.998888,  0.857998, 64.2084860,
		/* Skin 2 (asian male), only two lobes were used in this approximation
		 * so we make cx=cy=cz for the third lobe. (4) */
		-0.418599, -0.418599,  0.399808, 3.32765300,
		-0.418849, -0.418849,  0.397372, 3.50202900,
		-0.663313, -0.663313,  0.591432, 5.78286000,

		-1.030919, -1.030919,  0.832314, 28.2983690,
		-1.030556, -1.030556,  0.823648, 25.7667590,
		-1.042135, -1.042135,  0.797070, 31.0025620,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		/* Clay (5) */
		 1.089701,  1.089701, -1.354682, 17.9685050,
		 1.102701,  1.102701, -2.714801, 11.0244890,
		 1.107603,  1.107603, -1.569866, 21.2702820,

		 0.733381,  0.733381,  0.676108, 8.21974500,
		 0.793320,  0.793320,  0.679314, 9.05513900,
		 0.848206,  0.848206,  0.726031, 11.2619510,

		 1.010548,  1.010548,  0.910783, 152.912795,
		 1.012378,  1.012378,  0.885239, 141.937171,
		 1.011263,  1.011263,  0.892451, 201.046802,
		/* From "Efficient BRDF Importance Sampling Using a Factored
		 * Representation", by Jason Lawrence, Szymon Rusinkiewicz,
		 * Ravi Ramamoorthi */
		/* ct7, 2 lobes, (6) */
		-0.949600, -0.949600,  0.974200, 27.1348570,
		-0.949600, -0.949600,  0.974200, 27.1348570,
		-0.949600, -0.949600,  0.974200, 27.1348570,

		-0.490700, -0.490700,  0.379300, 501.747375,
		-0.490700, -0.490700,  0.379300, 501.747375,
		-0.490700, -0.490700,  0.379300, 501.747375,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* ct8, 2 lobes, (7) */
		-0.849500, -0.849500,  0.648600, 4.18963600,
		-0.849500, -0.849500,  0.648600, 4.18963600,
		-0.849500, -0.849500,  0.648600, 4.18963600,

		-0.873400, -0.873400,  0.501400, 85.4102780,
		-0.873400, -0.873400,  0.501400, 85.4102780,
		-0.873400, -0.873400,  0.501400, 85.4102780,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* From "Stochastic Local Search for BRDF Parameterization",
		  * Jonathan Backer, Fred Kimberley, Iryna Skrypnyk,
		  * University of British Columbia, Department of Computer Science */
		 /* Brushed metal, 1 lobe , (8) */
		-1.000000,  0.800000,  0.960000, 20.0000000,
		-1.000000,  0.800000,  0.960000, 20.0000000,
		-1.000000,  0.800000,  0.960000, 20.0000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Crossed brushed metal,2 lobes, (9) */
		-1.000000,  0.800000,  0.960000, 20.0000000,
		-1.000000,  0.800000,  0.960000, 20.0000000,
		-1.000000,  0.800000,  0.960000, 20.0000000,

		 0.800000, -1.000000,  0.960000, 20.0000000,
		 0.800000, -1.000000,  0.960000, 20.0000000,
		 0.800000, -1.000000,  0.960000, 20.0000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Latex paint, 1 lobe, (10) */
		-0.914000, -0.914000,  0.520000, 10.2100000,
		-0.914000, -0.914000,  0.520000, 10.2100000,
		-0.914000, -0.914000,  0.520000, 10.2100000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* From "A Comparison of Four BRDF Models", Stephen H. Westin,
		  * Hongsong Li, Kenneth E. Torrance,
		  * Cornell University Program of Computer Graphics */
		 /* White plastic, 2 lobes, (11) */
		-1.170000, -1.170000, -0.200000, 20.2000000,
		-1.160000, -1.160000, -0.164000, 20.9000000,
		-1.170000, -1.170000, -0.171000, 20.8000000,

		-0.989000, -0.989000,  0.854000, 21.5000000,
		-0.988000, -0.988000,  0.848000, 20.8000000,
		-0.989000, -0.989000,  0.858000, 21.9000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Metallic paint, 2 lobes, (12) */
		-0.992000, -0.992000,  1.010000, 34.4000000,
		-0.992000, -0.992000,  1.010000, 34.4000000,
		-0.992000, -0.992000,  1.010000, 34.4000000,

		-1.110000, -1.110000,  0.914000, 7.20000000,
		-1.110000, -1.110000,  0.914000, 7.20000000,
		-1.100000, -1.100000,  0.914000, 7.20000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Rough metal, 1 lobe, (13) */
		-1.010000, -1.010000,  1.010000, 405.500000,
		-1.010000, -1.010000,  1.010000, 405.500000,
		-1.010000, -1.010000,  1.010000, 405.500000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* White paper, 2 lobes, (14) */
		-1.110000, -1.110000,  0.005200, 20.4919000,
		-1.110000, -1.110000,  0.005200, 20.4919000,
		-1.110000, -1.110000,  0.005200, 20.4919000,

		-0.701000, -0.701000,  0.314000, 3.02650000,
		-0.701000, -0.701000,  0.314000, 3.02650000,
		-0.701000, -0.701000,  0.314000, 3.02650000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /*
		  * Cornell University Program of Computer Graphics,
		  *
		  * Blue felt hat, (15) */
		-0.277165, -0.277165, -0.093227, 2.79913300,
		-0.304075, -0.304075, -0.065992, 3.04789200,
		-0.027758, -0.027758, -0.020082, 1.19449700,

		-0.750466, -0.750466, -1.130948, 6.86094600,
		-0.749561, -0.749561, -1.167929, 6.93182700,
		-0.741817, -0.741817, -0.806141, 6.48485800,

		-1.100116, -1.100116, -0.476192, 69.0533333,
		-1.100492, -1.100492, -0.205529, 94.1173320,
		-1.100723, -1.100723, -0.249148, 94.0948310,
		/* Cornell University Program of Computer Graphics,
		 * Black felt hat, (16) */
		-0.304075, -0.304075, -0.065992, 3.04789200,
		-0.304075, -0.304075, -0.065992, 3.04789200,
		-0.304075, -0.304075, -0.065992, 3.04789200,

		-0.749561, -0.749561, -1.167929, 6.93182700,
		-0.749561, -0.749561, -1.167929, 6.93182700,
		-0.749561, -0.749561, -1.167929, 6.93218270,

		 1.004921,  1.004921, -0.205529, 94.1173320,
		 1.004921,  1.004921, -0.205529, 94.1173320,
		 1.004921,  1.004921, -0.205529, 94.1173320,
		/* Cornell University Program of Computer Graphics,
		 * light blue housepaint (from gonioreflectomer measurements,
		 * from The MDL File Format description
		 * Light blue housepaint, 3 lobes, (17) */
		 0.870567,  0.870567,  0.774290, 21.8201030,
		 0.857255,  0.857255,  0.619944, 18.5977550,
		 0.670982,  0.670982,  0.586674, 7.47271700,

		-0.451218, -0.451218,  0.023123, 3.02934200,
		-0.406681, -0.406681,  0.017625, 2.58149900,
		-0.477976, -0.477976,  0.227295, 3.67765300,

		-1.031545, -1.031545,  0.706734, 66.8990600,
		-1.029426, -1.029426,  0.696530, 63.7679120,
		-1.026588, -1.026588,  0.687715, 57.4891810,
		/* The following coefficients were fitted by Tek2Shoot for Tek2Shoot's
		 * T2S file format, and were taken from the T2S FilePack 01 for both
		 * Tek2Shoot's implementation of the Lafortune model, and T2SMaterial.
		 * The following data is used with permission, and our thanks go to
		 * Tek2shoot for allowing us to use this in Shrimp.
		 * */
		/* Cornell Dupont Cayman Lacquer, 1 lobe, (18)
		 * Cornell University Program of Computer Graphics */
		-0.173325, -0.173325, -0.781461, 3.49807873,
		 0.454890,  0.454890, -0.634748, 99.2031830,
		-0.843858, -0.843858,  0.855093, 4.48149667,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Cornell Lucite blue acrylic sheet, 2 lobes, (19)
		  * Cornell University Program of Computer Graphics */
		-0.273368, -0.273368,  0.544842, 15.3540081,
		-1.016822, -1.016822,  0.511180, 58.8669254,
		-0.002144, -0.002144,  0.012450, 0.41157227,

		-0.984130, -0.984130,  0.586031, 31.5951928,
		 0.394527,  0.394527,  0.518112, 31.9446199,
		 0.228052,  0.228052,  0.594629, 81.5213884,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Cornell Dupont Cayman lacquer, 3 lobes, (20)
		  * Cornell University Program of Computer Graphics */
		-0.173325, -0.173325, -0.781461, 3.49807873,
		 0.454890,  0.454890, -0.634748, 99.2031830,
		-0.843858, -0.843858,  0.855093, 4.48149667,

		 0.651240,  0.651240,  0.499618, 32.5904413,
		-0.460842, -0.460842,  0.533161, 2.61738924,
		 0.659845,  0.659845,  0.913306, 94.0399158,

		 0.593105,  0.593105, -0.472407, 43.6108944,
		-0.954684, -0.954684,  0.947450, 17.8507667,
		 0.017893,  0.017893, -1.165648, 86.9156883,
		 /* Cornell Dupli-color #T-345 Garnet Red, 3 lobes, (21)
		  * Cornell University Program of Computer Graphics */
		-1.025937, -1.025937,  0.903991, 5.10598868,
		-1.077204, -1.077204,  0.948621, 13.4201835,
		-0.282462, -0.282462,  0.611952, 50.0484632,

		-0.760609, -0.760609,  0.346711, 23.1010041,
		 0.688179,  0.688179, -0.820881, 20.0529406,
		-1.074772, -1.074772,  0.951596, 13.4361415,

		-0.009799, -0.009799,  0.536784, 34.5560430,
		 0.415645,  0.415645,  0.258585, 41.7149715,
		 0.745843,  0.745843, -1.132337, 30.2359552,
		 /* Cornell Krylon latex enamel #7205 true blue, 3 lobes, (22)
		  * Cornell University Program of Computer Graphics */
		-1.057005, -1.057005,  0.963547, 18.5105467,
		 0.929711,  0.929711,  0.045010, 34.2075600,
		 0.008381,  0.008381, -0.035681, 71.0403299,

		-0.873863, -0.873863, -1.083791, 91.3512345,
		-1.055084, -1.055084,  0.941551, 12.9932874,
		-0.972992, -0.972992,  0.894615, 7.34510381,

		 0.139261,  0.139261,  0.409108, 68.6002011,
		 0.316102,  0.316102,  0.848652, 67.1037080,
		-0.276858, -0.276858,  0.164552, 71.3047580,
		/* Cornell Mystic lacquer, 3 lobes, (23)
		 * Cornell University Program of Computer Graphics */
		-0.999826, -0.999826,  0.789807, 9.70787057,
		-1.005055, -1.005055,  0.981262, 48.4931661,
		-0.879974, -0.879974,  0.937616, 13.5852866,

		-0.003659, -0.003659,  0.058949, 14.4357102,
		 0.809336,  0.809336, -0.562357, 83.4399016,
		 0.380274,  0.380274,  0.052122, 12.9578797,

		 0.896162,  0.896162, -0.682992, 70.1848983,
		 0.846448,  0.846448, -1.073572, 11.5369330,
		 0.252795,  0.252795,  0.296871, 50.0292471,
		 /* Columbia-Utrecht CURET database */
		 /* Moss, 3 lobes, (24) */
		-0.057908, -0.057908, -1.155984, 92.2579064,
		-0.707181, -0.707181, -0.637487, 4.76732578,
		-1.010898, -1.010898, -0.880208, 56.0094202,

		 0.297689,  0.297689, -0.673168, 53.5099655,
		 0.999785,  0.999785,  0.256750, 70.3864367,
		-0.818312, -0.818312,  0.833275, 48.6778895,

		-0.838135, -0.838135, -0.444171, 6.78210572,
		 0.753294,  0.753294, -0.367645, 7.08576702,
		 0.244035,  0.244035, -0.903976, 31.1632730,
		 /* Leather, 3 lobes, (25) */
		 0.038217,  0.038217,  0.202051, 64.5739571,
		-0.898415, -0.898415, -0.515324, 39.9133987,
		-0.973591, -0.973591,  0.882804, 34.1863167,

		-0.533545, -0.533545,  0.246292, 81.5689912,
		-0.966528, -0.966528,  0.873937, 19.9655105,
		 0.446632,  0.446632, -0.413421, 84.3297094,

		-0.962059, -0.962059,  0.859141, 16.1487687,
		-0.749053, -0.749053,  0.319919, 13.0047418,
		 0.515970,  0.515970, -1.006305, 47.8641224,
		 /* Quarry Tile, 3 lobes, (26) */
		-0.566120, -0.566120,  0.530068, 4.40661611,
		 0.023845,  0.023845, -0.051721, 90.0736631,
		-0.667986, -0.667986,  0.528288, 7.12040977,

		-0.393463, -0.393463,  0.799419, 25.4159424,
		-0.750236, -0.750236,  0.602427, 7.08394094,
		 0.565543,  0.565543,  0.516894, 22.1738832,

		-0.899461, -0.899461, -1.164123, 16.5231589,
		-0.044097, -0.044097, -0.141345, 37.4155699,
		-0.683016, -0.683016,  0.282586, 95.7591231,
		/* Brick, 1 lobe, (27) */
		-0.975620, -0.975620,  0.641767, 10.4985275,
		-0.950737, -0.950737,  0.638265, 11.1676268,
		-0.894881, -0.894881,  0.528076, 11.7365466,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,

		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 0.000000,  0.000000,  0.000000, 1.00000000,
		 /* Frosted glass, 3 lobes, (28) */
		-0.419656, -0.419656,  0.489333, 9.81298664,
		-0.620238, -0.620238,  0.061031, 1.86343036,
		 0.157477,  0.157477, -0.460763, 43.0616879,

		-0.152879, -0.152879, -1.198680, 13.2241912,
		-0.998439, -0.998439, -0.882754, 7.88445040,
		-0.811133, -0.811133,  0.212033, 4.12481185,

		-0.996862, -0.996862,  0.314375, 3.40579256,
		 0.890484,  0.890484,  0.748944, 44.3834383,
		-0.361865, -0.361865, -0.835242, 90.8124691
	};
	uniform float i;
	for (i = 0; i < 36; i += 1) { /* 0 to N_LOBES*N_WAVES*LOBESIZE */
		lobedata[i] = coeffs[model*36+i];
	}
}

////////////////////////////////////////////////////////////////////////////////
#endif /* RSL_DATA_H */

